package com.quan.server.helper;

import com.taobao.api.internal.util.RequestCheckUtils;

import java.util.Map;

import com.taobao.api.ApiRuleException;
import com.taobao.api.BaseTaobaoRequest;
import com.taobao.api.internal.util.TaobaoHashMap;

/**
 * TOP API: taobao.tbk.item.info.get request
 *
 * @author top auto create
 * @since 1.0, 2017.09.05
 */
public class MyTbkItemInfoGetRequest extends BaseTaobaoRequest<MyTbkItemInfoGetResponse> {

    /**
     * 需返回的字段列表
     */
    public String fields;

    /**
     * 商品ID串，用,分割，从taobao.tbk.item.get接口获取num_iid字段，最大40个
     */
    public String numIids;


    @Override
    public String getApiMethodName() {
        return "taobao.tbk.item.info.get";
    }

    @Override
    public Map<String, String> getTextParams() {
        TaobaoHashMap txtParams = new TaobaoHashMap();
        txtParams.put("fields", this.fields);
        txtParams.put("num_iids", this.numIids);

        if (this.udfParams != null) {
            txtParams.putAll(this.udfParams);
        }
        return txtParams;
    }

    @Override
    public Class<MyTbkItemInfoGetResponse> getResponseClass() {
        return MyTbkItemInfoGetResponse.class;
    }

    @Override
    public void check() throws ApiRuleException {
        RequestCheckUtils.checkNotEmpty(fields, "fields");
        RequestCheckUtils.checkNotEmpty(numIids, "numIids");
    }
}